// FrogDecryptDialog.cpp : Implementation of CFrogDecryptDialog

#include "stdafx.h"
#include "FrogDecryptDialog.h"


// CFrogDecryptDialog

CFrogDecryptDialog::CFrogDecryptDialog(HICON hIcon):
CFrogProgressReportDialog(hIcon),
m_StrPassword(L"")
{

}

LRESULT CFrogDecryptDialog::OnInitDialog(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
{
	CFrogProgressReportDialog::OnInitDialog(uMsg, wParam, lParam, bHandled);
	DoDataExchange(FALSE);

	return 0;
}

LRESULT CFrogDecryptDialog::OnClickedOK(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled)
{
	bHandled = TRUE;
	// TODO: Add your control notification handler code here
	DoDataExchange(TRUE);

	m_Password = m_StrPassword;

	RunAsyncCommandWithProgressBar(false);

	EndDialog(wID);
	return 0;
}

void CFrogDecryptDialog::ExecuteCommand()
{
	Sleep(1000);
	m_FilesRefactor.Decrypt(m_LastResult, m_FilesList, m_Password);
}